
/*!
        \file
		\brief Dialog with currency settings.

		\author Igor Mironchik (igor.mironchik at gmail dot com).

        Copyright (c) 2010 - 2011 Igor Mironchik

        Permission is hereby granted, free of charge, to any person
        obtaining a copy of this software and associated documentation
        files (the "Software"), to deal in the Software without
        restriction, including without limitation the rights to use,
        copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the
        Software is furnished to do so, subject to the following
        conditions:

        The above copyright notice and this permission notice shall be
        included in all copies or substantial portions of the Software.

        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
        EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
        OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
        NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
        HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
        WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
        FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
        OTHER DEALINGS IN THE SOFTWARE.
*/

#ifndef ESHOPHELPER__CURRENCY_HPP__INCLUDED
#define ESHOPHELPER__CURRENCY_HPP__INCLUDED

// Qt include.
#include <QtGui/QDialog>

// eHopHelper include.
#include <eShopHelper/ui_currency.h>
#include <eShopHelper/h/settings.hpp>


namespace eShopHelper {

//
// CurrencyDialog
//

//! Dialog with currency settings.
class CurrencyDialog
	:	public QDialog
{
	Q_OBJECT

public:
	explicit CurrencyDialog( Settings & s,
		QWidget * parent = 0, Qt::WindowFlags f = 0 );
	~CurrencyDialog();

private slots:
	//! Changed index in the currency combo box.
	void slotCurrencyIndexChanged( int idx );
	//! Changed value of the VAT.
	void slotVATValueChanged( double v );
	//! Currency first value changed.
	void slotCur1ValueChanged( double v );
	//! Currency second value changed.
	void slotCur2ValueChanged( double v );
	//! Currency third value changed.
	void slotCur3ValueChanged( double v );
	//! Changed value in the check box.
	void slotWithVATStateChanged( int state );

private:
	//! Init dialog.
	void init( const Settings & s );

private:
	//! UI.
	Ui::CurrencyDlg m_ui;
	//! Settings of the application.
	Settings & m_settings;
}; // class CurrencyDialog

} /* namespace eShopHelper */

#endif // ESHOPHELPER__CURRENCY_HPP__INCLUDED
